from __future__ import annotations
import enum
from typing import Optional
from pydantic import BaseModel


class ItemType(enum.Enum):
    Video = 1
    Dir = 0


# class Item(BaseModel, abc.ABC):
#     name: str
#     path: str



class VideoItem(BaseModel):
    name:str
    # path:str
    # vid:int
    parent:str
    # duration: int
    # type: int = ItemType.Video


class DirItem(BaseModel):
    name:str
    path:str
    # type:int = ItemType.Dir
    sub_dirs:list[str]
    videos:list[str]
    error:Optional[str]

    @staticmethod
    def NoExist(path,name):
        return DirItem(name=name,path=path,sub_dirs=[],videos=[],error='No Such Directory!')
